1. Technical Field
The present invention relates to an image data compression device, an encoder, an electronic apparatus, and a method of compressing image data.
2. Related Art
As a general purpose encoding method for multimedia information such as image data of static images or moving images or voice data, MPEG-4 (Moving Picture Experts Group Phase 4) has been standardized. Portable instrument of recent years is capable of realizing encoding and decoding of image data compliant with the MPEG-4 standard to reproduce moving images or to communicate the moving images through a network.
According to the MPEG-4 standard, compressed data obtained by encoding image data of a moving image need to be generated at a constant rate. However, when compressing image data of moving images, the compression efficiency is varied greatly depending on the content of the image data. In MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999(E) L), there is described a rate control method for generating the compressed data at a constant rate by controlling the code value to be generated so that the variation is fallen within a predetermined range.
It can be considered that, in performing the encoding (compressing) processes of the MPEG-4, the series of processes are executed by hardware. However, in this case, a large circuit scale is required, and if the circuit is made as an IC (semiconductor device, integrated circuit), it becomes difficult to miniaturize the IC. In particular, in portable instruments such as mobile phones, it cannot meet the requirement for miniaturization of the instruments.
In contrast, it can be considered that the series of processes of encoding is executed with software. However, in this case, a load on the CPU (Central Processing Unit) for executing the software is problematically increased. Accordingly, time the CPU consumes for other processes is constrained, thus degrading the performance of the instrument equipped with the CPU. Further, it causes the processing time to be increased, thus increasing power consumption. In particular, in portable instruments such as mobile phones, it cannot meet the requirement for low power consumption for restricting consumption of the battery.
In view of the above, it can be considered that the series of processes of encoding is shared by both hardware and software. However, as a result of study by the present inventors, it has been revealed that, when considering the most effective way of sharing the series of encoding processes by hardware and software, the rate control method disclosed in the MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999(E) L) cannot be put into practice. That is, when sharing it by the hardware process and the software process each having a different processing speed, a buffer for absorbing the difference of the speeds is required. However, it has been revealed that, if the buffer is provided, the rate control method cannot be executed, thus the optimization of assignment of image data compression process to hardware and software and generation of compressed data at a constant rate are problematically incompatible.
Further, even if the generation rate of the compressed data can be controlled, the rate control method described in the MPEG-4 Visual Part (Recommendation ISO/IEC 14496-2: 1999(E) L) often causes block noises displayed in the image obtained by expanding the compressed data, thus the display quality can problematically be degraded.
Meanwhile, the amount of the compressed data is increased in order to prevent degradation of the display quality, thus it is problematical that a predetermined bit rate may not be maintained. For example, when the encoding process is executed for maintaining a predetermined bit rate, the maximum encoding size which can be generated as a result of encoding is determined in accordance with the encoding time. In this case, if a large number of bits are used in the first half of the encoding process, the possibility of causing the bit rate overrun is increased, and it becomes difficult to maintain the predetermined bit rate.
The present invention is proposed in view of the above technical problems, and aims to provide an image data compression device, an encoder, an electronic instrument, and a method of compressing image data, capable of optimizing assignment of the image data compression process to hardware and software, and of surely generating compression data at a constant rate while preventing degradation of the display quality.